<div class="panes_vertical">
	<div class="box">	
		<form method="post" action="<{$APPLICATION_URL}>/Admin/FaqCategory/add" name="frmForm" enctype="multipart/form-data">
			<fieldset>
				<legend>Add New Faq Category</legend>												
				<p>
					<label>Parent's Category:</label>
					<select name="parentId" id="parentId">						
						<option value='0' <{if $parentId == 0}> selected="selected" <{/if}>>ROOT</option>
						<{foreach name=outer item=cat from=$arrCatList}>												
							<option value="<{$cat->id}>" <{if $parentId == $cat->id}> selected="selected" <{/if}>><{$cat->name}></option>							
						<{/foreach}>
				</select>
				</p>
				<p>
					<label>Name:</label>
					<input type='text' id='name' name='name' value='<{$name}>' class="textfield">					
				</p>
				<p>
					<label>Description:</label>
					<textarea name="description" id="description" name="description" cols="30" rows="12"><{$description}></textarea>					
				</p>
				<p>
					<label>Status:</label>
					<select name="status" id="select">
						<option value=''>-- Select one --</option>
						<{html_options options = $statusList selected=$status}>
					</select>
				</p>
				<p>
					<input type="button" name="save" class="button" id="save" value=" Submit " onclick="formSubmit();" />
					<input type="reset" name="reset" class="button" id="reset" value=" Reset " />										
					<input type="hidden" id="id" name="id" value="<{$id}>" />
					<input type="hidden" id="actionForm" name="actionForm" value=""/>
					<input type="hidden" id="actionKey" name="actionKey" value="<{$actionKey}>" />
				</p>
			</fieldset>
		</form>
	</div>
</div>

<script type="text/javascript">
    function formSubmit()
    {
    	var theform = document.frmForm;
    	
    	// Check Name
    	var name = theform.name.value;
    	if (name == ''){
			alert('Name is invalid');
			theform.name.focus();
			return false;
    	} 	

    	// Check status
    	var status = theform.status.value;
    	if (status == ''){
			alert('Status is invalid');
			theform.status.focus();
			return false;
    	}

    	theform.actionForm.value = 'submit';
    	theform.submit();
    	return true;
    }
</script>